var pieOption=function(data,head){

	var name = data.name;
	var aggType = data.aggType;
	var dimensionData = data.data;
	var cdId = data.cdId;
	var type = data[aggType];
	var xValue = [];
	var yValue = [];
	if (dimensionData) {
		for ( var i = 0; i < dimensionData.length; i++) {
			xValue.push(dimensionData[i].Name);
			var temp = {
					name:dimensionData[i].Name,
					value:dimensionData[i][cdId]
			}
			yValue.push(temp);
		}
	}else{
		xValue.push(name);
		yValue.push({name:name,value:data[cdId]});
		if(!data[aggType]){
			yValue = [];
		}
	}
	



	return {
		    title : {
		        text: head,				//主标题
//		        subtext: subhead,		//副标题
		        x:'center',
//		        y:'bottom'
		    },
		    tooltip : {
		    	show:false,
		        trigger: 'item',
		        formatter: "{a} <br/>{b} : {c} ({d}%)"
		    },
		    legend: {
		    	show:true,
		        orient : 'vertical',
		        x : 'left',
		        y : 36,
		        data:xValue				//统计字段值
		    },
		    toolbox: {
		        show : false,
		        feature : {
		            mark : {show: false},
		            dataView : {show: false, readOnly: false},
		            magicType : {
		                show: false, 
		                type: ['pie', 'funnel'],
		                option: {
		                    funnel: {
		                        x: '25%',
		                        width: '50%',
		                        funnelAlign: 'left',
		                        max: 1548
		                    }
		                }
		            },
		            restore : {show: false},
		            saveAsImage : {show: true}
		        }
		    },
		    calculable : false,
		    series : [
						{
//						    name:name,
						    type:'pie',
//						    radius : '55%',//radius
						    radius : ['50%','75%'],//radius
						    center: ['65%', '55%'],
						    itemStyle : {   //图形样式
				                normal : { //默认样式
				                    label : {
				                        show : false
				                    },
				                    labelLine : {
				                        show : false
				                    }
				                }
						    },
						    data:yValue
						 }  
		              
		         ],
		         noDataLoadingOption:{
		            	text :"暂无数据",
		            	    effect : 'bubble',
		            	    effectOption:{
		            	    	backgroundColor:"#fff",
		            	    	effect:{
		            	    		n:0
		            	    	}
		            	    },
		            	    textStyle : {
		            	        fontSize : 20
		            	    }
		            }
		};
		                    
}